<!--{Atemplate tpl/header}-->
<!--{Atemplate tpl/left}-->
<script>
jQuery(document).ready(function(){
});

//申诉
function kh_sh(id,exp){
	html='';
	html+=Ahtml.tag('p',{},Ahtml.tag('input',{type:'text',value:exp,readonly:'readonly'},'投诉快号'));
	html+=Ahtml.tag('p',{},Ahtml.select({name:'reason'},$reason_json,'','投诉原因'));
	html+=Ahtml.tag('input',{type:'hidden',name:'id',value:id});
	html+=Ahtml.tag('p',{},Ahtml.tag('input',{type:'submit','class':'_btn',value:'提交'}));
	html = Ahtml.tag('form',{onsubmit:'kh_sh_post();return false;'},html);
	Acan.base.showbox('kh_sh','申诉',html,{'close':1,css:{width:'300px',height:'120px'}});
}
function kh_sh_post(){
	var data = jQuery('#kh_sh form').serialize();
	var id = jQuery('#kh_sh input[name="id"]').val();
	jQuery.ajax({
		type:'post',
		url:'/$this->Amodr-appeal',
		data:data,
		success: function(rs){//成功
			if (rs==1) {
				Acan.alert('投诉提交成功',2000);
				jQuery('._'+id).remove();
			}else{
				Acan.alert('已投诉',2000);
			}
			Acan.close('kh_sh');
		}
	});
	return false;
}
</script>
<script language="javascript" type="text/javascript" src="{Acan_path_js}/plugin/My97DatePicker/WdatePicker.js"></script>
<div class="Aright">
<div class="_l">
<form id="exp_search" method="get" action="">
	<div class="_p">
		<span class="add-on">$this->enum[cash][$type] 时间：</span>
		<input class="Wdate" name="start_date" type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH',minDate:'%y-%M-{%d-7} 00',maxDate:'%y-%M-{%d+1} 00'})" value="$_GET[start_date]">
		<span class="add-on">到：</span>
		<input class="Wdate" name="end_date" type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH',minDate:'%y-%M-{%d-7} 00',maxDate:'%y-%M-{%d+2} 00'})" value="$_GET[end_date]">
		<button class="_btn" type="submit">提交查询</button>
	</div>
</form>
</div>

<div class="_l">
	<div class="list_nav">
		<h2>{$this->enum[cash][$type]}记录</h2>
	</div>
	<table class="-table list_exp">
		<tr>
			<th style="width:20px">#</th>
			{if $type>=21}
			<th style="width:160px">订单号</th>
			<th style="width:190px">商家订单号</th>
			{else}
			<th style="width:100px">快号</th>
			<th style="width:80px">快递类型</th>
			<th style="width:160px">预计发货时间</th>
			{/if}
			{if $type==1}
			<th style="width:80px">类型</th>
			{/if}
			{if $type>=2 && $type<21}
			<th style="width:160px">购买时间</th>
			{elseif $type>=21}
			<th style="width:160px">类型</th>
			{else}
			<th style="width:160px">时间</th>
			{/if}
			<th style="width:40px">价格</th>
			{if $type==2 || $type==3 || $type==4}
			<th style="width:120px">操作</th>
			{/if}
		</tr>
		<!--{eval $i=0;}-->
		<!--{loop $list $key $val}-->
		<!--{eval $i++;}-->
		<tr class="_$val[id]">
			<td>$i</td>
			<td>$val[cash_id]</td>
			{if $type>=21}
			<td>$val[rid]</td>
			{else}
			<td>$edata[$val[rid]][com_alt]</td>
			<td>$edata[$val[rid]][send_date]</td>
			{/if}
			{if $type==1}
			<td>$this->enum[cash][$val[type]]</td>
			{/if}
			{if $type>=2 && $type<21}
			<td>$val[buydate]</td>
			{elseif $type>=21}
			<td>$this->enum[bank_type][$val[bank_type]]</td>
			{else}
			<td>$val[update]</td>
			{/if}
			<td>$val[cash]</td>
			{if $type==2 || $type==3 || $type==4}
			<td class="cash_cz">
				<a href="http://www.kuaidi100.com/chaxun?com={$edata[$val[rid]][com]}&nu={$val[cash_id]}" target="_blank" class="_btn">查询</a>
				{if $val[type]==2}
				{if strtotime($val[buydate])>$sh_time}<button onclick="kh_sh($val[id],'$val[cash_id]')" class="_btn">申诉</button>{/if}
				{elseif $val[type]==4}
					{if $val[status]==12}
					<button >申诉通过</button>
					{elseif $val[status]==13}
					<button >申诉失败</button>
					{else}
					<button >申诉中</button>
					{/if}
				{/if}
			</td>
			{/if}
		</tr>
		{if $type==2 || $type==3 || $type==4}
		<tr class="_$val[id]">
			<td></td>
			<td colspan="6">
			{if $type==4}申诉原因:$this->enum[reason][$val[bank_type]] {/if}发货地址：$edata[$val[rid]][fh_alt]   收货地址：$edata[$val[rid]][sh_alt]   是否扫描：$edata[$val[rid]][scan_alt]</td>
		</tr>
		{/if}
		<!--{/loop}-->
	</table>
	<div class="_page">$pages->html</div>
</div>

</div>
<!--{Atemplate tpl/footer}-->